package com.icemelon.catdog.service;

import com.icemelon.catdog.dao.FriendMapper;
import com.icemelon.catdog.pojo.Friend;
import com.icemelon.catdog.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

@Service
public class IdolServiceImpl implements IdolService {
    @Autowired
    private FriendMapper idolMapper;


    @Override
    public List<Friend> findById(Integer[] ids) {
        List<Integer> list= Arrays.asList(ids);

        return idolMapper.selectBatchIds(list);
    }

    @Override
    public int deleteById(Integer[] id) {
        return idolMapper.deleteById(id);
    }

    @Override
    public int insertById(Integer id) {
        Friend friend = new Friend();
        friend.setFan(id);
        friend.setIdol(id);
        return idolMapper.insert(friend);
    }


}




